package com.simon.train.member.controller.admin;


import com.simon.train.common.Result.Result;
import com.simon.train.common.vo.PageVO;
import com.simon.train.member.dto.TicketQueryDto;
import com.simon.train.member.service.TicketService;
import com.simon.train.member.vo.TicketQueryVO;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/ticket")
public class TicketAdminController {

    @Resource
    private TicketService ticketService;

    @GetMapping("/queryList")
    public Result<PageVO<TicketQueryVO>> TicketQueryList(@Valid TicketQueryDto ticketQueryDto){
         /**
         * memberId通过线程变量获取 从而不需要由前端传入 保证了效率和安全性
         */
        PageVO<TicketQueryVO> lists = ticketService.QueryTicketList(ticketQueryDto);
        return new Result<>(lists);
    }

}
